package com.xjscrm.console.web.operatePlan;

import com.xjscrm.console.param.operatePlan.BatchSetAddFanGroupDto;
import com.xjscrm.console.param.operatePlan.FindAddFanGroupDto;
import com.xjscrm.console.param.operatePlan.SetAddFanGroupDto;
import com.xjscrm.console.service.customer.group.AddFanGroupService;
import com.xjscrm.console.vo.FindAddFanGroupVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "进粉群管理", tags = "进粉群管理")
@RestController
@RequestMapping(value = "/addFanGroup")
public class AddFanGroupController {

    @Autowired
    private AddFanGroupService addFanGroupService;


    @ApiOperation(value = "群卡片数据设置当前进粉群", notes = "群卡片数据设置当前进粉群", response = Boolean.class)
    @PostMapping("/set")
    public Object setAddFanGroup(@RequestBody SetAddFanGroupDto setAddFanGroupDto){
        addFanGroupService.setAddFanGroup(setAddFanGroupDto);
        return true;
    }

    @ApiOperation(value = "群卡片数据批量设置当前进粉群", notes = "群卡片数据批量设置当前进粉群", response = Boolean.class)
    @PostMapping("/set/batch")
    public Object setAddFanGroup(@RequestBody BatchSetAddFanGroupDto batchSetAddFanGroupDto){
        addFanGroupService.batchSetAddFanGroup(batchSetAddFanGroupDto);
        return true;
    }

    @ApiOperation(value = "群卡片数据查询当前进粉群", notes = "群卡片数据查询当前进粉群", response = FindAddFanGroupVo.class)
    @PostMapping("/find")
    public Object findAddFanGroup(@RequestBody FindAddFanGroupDto findAddFanGroupDto){
        return addFanGroupService.findAddFanGroup(findAddFanGroupDto);
    }
}
